package lynch.core
{
	public class InfoCenter
	{
		/**
		 * get any info you want in Core.config.txt
		 */
		public function InfoCenter()
		{
		
		}
		
		/**
		 * get any info in Core.config.txt by ID
		 * @param	id
		 * @param	... rest
		 * @return
		 */
		public function getInfoByID(id:int, ... rest):Array
		{
			//不可能根据ID范围确定类型,不过现在没配置表,暂时这样
			if (id >= 400 && id <= 1000)
				return ["技能"];
			if (id > 5000 && id < 6000)
				return ["增益"];
			if (id > 100000)
				return ["地图"];
			return ["服装"];
		}
		
		public function getImagePathByID(id:int):String
		{
			var path:String;
			var back:String = ".jpg";
			switch (getInfoByID(id, "btype")[0])
			{
				case "地图":
					path = "map";
					break;
				case "服装":
					path = "player";
					back = ".png";
					break;
				case "增益":
					path = "buff";
					back = ".png";
					break;
				case "技能":
					path = "skill";
					back = ".png";
					break;
			}
			return "resource/" + path + "/" + id + back;
		}
		
	}

}